export function getSelectOptionsFun(){
  const random = Math.floor( Math.random() * 5) + 2
  let result = []
  for( let i=0;i<random;i++){
    result.push({
      value:i,label:`选项${i+1}`,
    })
  }
  return result
}

export function getCascaderOptionsFun(){
  let result = []
  const random1 = Math.floor( Math.random() * 5) + 1
  for(let i=0;i<random1;i++){
    result.push({
      value: i.toString(),
      label: `xxx省${i}`,
      children: []
    })

    const random2 = Math.floor( Math.random() * 5) + 1
    for( let j=0;j<random2;j++){
      result[i].children.push({
        value: j.toString(),
        label: `xxx市${j}`,
        children: []
      })

      const random3 = Math.floor( Math.random() * 5) + 1
      for( let k=0;k<random3;k++){
        result[i].children[j].children.push({
          value: k.toString(),
          label: `xxx区${k}`,
          children: []
        })

        const random4 = Math.floor( Math.random() * 5) + 1
        for( let l=0;l<random4;l++){
          result[i].children[j].children[k].children.push({
            value: l.toString(),
            label: `xxx镇${l}`,
          })

        }
      }
    }
  }
  return result
}

export function getCurrentDay(needHms){
  const currentDate = new Date()
  const year = currentDate.getFullYear()
  const month = (currentDate.getMonth() + 1).toString().padStart(2, '0')
  const day = currentDate.getDate().toString().padStart(2, '0')
  let result = `${year}-${month}-${day}`
  if( needHms === true){
    const hms = currentDate.getHours().toString().padStart(2, '0') + ':'
    + currentDate.getMinutes().toString().padStart(2, '0') + ':'
    + currentDate.getSeconds().toString().padStart(2, '0')
    result += ' '+hms
  }
  return result
}